package org.toy.wechat.gym.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.toy.wechat.core.common.base.BaseResult;
import org.toy.wechat.core.common.base.BaseResultGenerator;
import org.toy.wechat.gym.request.GymBmiRequest;
import org.toy.wechat.gym.service.IGymBmiInfoService;

import javax.validation.Valid;

/**
 * @Description
 * @Author devin
 * @Date 2020/2/22 17:10
 */
@RestController
@RequestMapping("/gym/info")
@Api(value = "/test", tags = "测试接口模块")
public class GymBmiInfoController {

    @Autowired
    private IGymBmiInfoService gymBmiInfoService;

    @ApiOperation(value = "添加BMI信息", notes = "添加BMI信息")
    @PostMapping("/add")
    public BaseResult insertGymInfo(@RequestBody @Valid GymBmiRequest request)  {
        gymBmiInfoService.insert(request);
        return BaseResultGenerator.success();
    }
}
